<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires",0);
%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%@ page language="java" import='java.util.ArrayList'%>
<%@ page language="java" import='java.util.List'%>
<%@ page language="java" import='com.dgac.licencias.to.*'%>
<%@ page language="java" import='com.dgac.licencias.util.*'%>
<%@ page language="java" import='java.text.DecimalFormat'%>

<html><head><title>SOLICITAR OTORGAMIENTO DE LICENCIA</title>
<meta http-equiv="Content-Type" content="text/html; charset=unicode"><link 
href="/WebLicencias/css/espacio.css" type=text/css rel=stylesheet>
<link 
href="/WebLicencias/css/calendar-system.css" type=text/css rel=stylesheet>
<script language="javascript" src="/WebLicencias/js/calendar.js"></script>
<script language="javascript" type="text/javascript" src="/WebLicencias/js/js.Farmacia.Function.js"></script>
<script language="javascript" src="/WebLicencias/js/calendar-es.js"></script>
<script language="javascript" src="/WebLicencias/js/utils.js"></script>

<script language="javascript">
setResizableElements('res');
     function Buscar(pagina){
       document.tramite.action="/WebLicencias/BuscarTramite.do";
       document.tramite.page.value=pagina;
       document.forms["tramite"].submit();
                
    }
     function ExportarXLS(){
       document.tramite.action="/WebLicencias/BuscarTramiteXLS.do";
       document.forms["tramite"].submit(); 
    }
</script>

<meta content="MSHTML 6.00.6000.16945" name="GENERATOR"></head>
<body>
<table width="100%" align="center" bgcolor="#fffdd6" border="0">
  <tbody>
  <tr>
    <td></td></tr>
  <tr>
    <td></td></tr>
  <tr>
    <td></td></tr>
  <tr>
    <td>
      <div class="Titulo1B" align="center">TRAMITES DE LICENCIAS</div></td></tr>
  <tr>
    <td>
      <table width="98%" align="left">
        <form id="tramite" name="tramite" action="BuscarTramite.do">
        <input type="hidden" name="metodo" value="buscar" id="metodo">  
          <input type="hidden" name="page" value="">  
        <tbody>
        <tr>
          <td>
            <fieldset class="TablaBorde"><legend class="TituloAzulClaro">Filtrado 
            por </legend>
            <table style="WIDTH: 516px; HEIGHT: 71px" width="516" align="center">
              <tbody>
              <tr>
                <td class="TituloAzulClaro" align="right">No&nbsp;Tramite&nbsp;</td>
                <td><input class="Campo" maxlength="20" name="txttramite"></td>
                <td class="TituloAzulClaro" align="right">Tipo</td>
                <td><select class="Combo" style="WIDTH: 184px" size="1" 
                  name="txttipotra"><option value="0" selected>Seleccione</option> 
                    <option value="1">OTORGAMIENTO</option> <option 
                    value="2">RENOVACION</option> <option 
                    value="3">DUPLICADO</option> &lt;\SELECT&gt;</select></td></tr>
              <tr>
                <td class="TituloAzulClaro" 
                align=right>Fecha&nbsp;Solicitud&nbsp;</td>
                <td><input class="Campo" maxlength="20" name="txtfecsol" id="txtfecsol"><input class="Boton2" onclick="return showCalendar('txtfecsol','dd/mm/y');" type="button" value="..." name="Submit322222"></td>
                <td class="TituloAzulClaro" align="right">Estado</td>
                <td><select class="Combo" style="WIDTH: 184px" size="1" 
                  name="txtestado"><option value="" selected>Seleccione</option> 
                    <option value="N">NUEVO</option> <option value="P">EN 
                    PROCESO</option> <option 
                    value="A">ANULADO</option> <option 
                    value="F">FINALIZADO</option> &lt;\SELECT&gt;</select></td></tr>
              <tr>
                <td class="TituloAzulClaro" align="right">Licencia</td>
                <td colspan="3">
                    <select class="Combo" style="WIDTH: 161px" size="1" name="txttipolic">
                  <option value="0" selected>Seleccione</option>
                  <%
                     ArrayList listlic = (ArrayList) request.getSession().getAttribute("listLicencias");
                     for (int i = 0; i < listlic.size(); i++) {
                       LicenciaTO lics = (LicenciaTO) listlic.get(i);
                     %>
                      <option value="<%=lics.getCodLicencia() %>"><%=lics.getDescripcion() %></option>
                     <%
                     }
                    %>
              </select>
                    </td></tr>
              <tr>
                <td class="TituloAzulClaro" align="right">Solicitante</td>
                <td colspan="3"><input class="Campo" maxlength="80" size="80" 
                  name="txtapepat"></td></tr>
              <tr>
                <td class="TituloAzulClaro" align="right">Solicitante Tipo Doc</td>
                <td colspan="3"><select class="Combo" style="WIDTH: 184px" size="1" 
                  name="txttipodoc"><option value="0" selected>Seleccione</option> 
                    <option value="1">DNI</option> <option 
                    value="2">C.EXT</option> <option 
                    value="3">PASAPORTE</option> &lt;\SELECT&gt;</select></td></tr>
              <tr>
                <td class="TituloAzulClaro" align="right">Solicitante No 
                Documento</td>
                <td colspan="3"><input class="Campo" maxlength="20" 
              name="txtnumdoc"></td></tr></tbody></table></fieldset></td></tr></tbody></table></td></tr>
  <tr>
    <td class="TextoPortal" colspan="2">
      <div align="center">&nbsp; <input class="boton" onclick="Buscar('0');return false;" type="button" value="Buscar" name="Submit22">&nbsp; 
      </div></td></tr></tbody></table>
<div id="idTabla" style="DISPLAY: inline">
<table width="100%" align="center" bgcolor="#fffdd6" border="0">
  <tbody>
  <tr>
    <td>
      <div id="res">
      <br>
      <table class="consultanormal" id="row" cellspacing="0" align="center">
        <thead>
        <tr>
          <th class="sortable" width="5%">Ver&nbsp;&nbsp;</th>
          <th class="sortable" width="5%"><a style="COLOR: white" href="#">No 
            Tramite</a></th>
          <th class="sortable" width="30%"><a style="COLOR: white" 
            href="#">Solicitante</a></th>
          <th class="sortable" width="15%"><a style="COLOR: white" href="#">Tipo 
            Tramite</a></th>
          <th class="sortable" width="5%"><a style="COLOR: white" 
            href="#">Fecha Solicitud</a></th>
          <th class="sortable" width="15%"><a style="COLOR: white" 
            href="#">Estado</a></th>
          <th class="sortable" width="20%"><a style="COLOR: white" 
            href="#">Licencia</a></th></tr></thead>
        <tbody>
         <%
           Page result = (Page) request.getSession().getAttribute("listTramites");
           int hits=0;
           if (result!=null) {
                ArrayList listtra =(ArrayList) result.getResults();
           hits=listtra.size(); 
           for (int i = 0; i < listtra.size(); i++) {
                    SolicitudDeTramiteTO sol = (SolicitudDeTramiteTO) listtra.get(i);
                    String[] clase = {"odd","even"};
         %>
        
        <tr class="<%=(clase[i%2])%>">    
        
          <td>
            <div align="center"><img title="Ver Licencias" style="CURSOR: hand" 
            onclick="navigate('verTramite.do?sol=<%= sol.getCodSolicitud() %>')" height=20 hspace=0 
            src="/WebLicencias/imagenes/boton_buscar.gif" width=20 align=middle border=0> </div></td>
          <td class="TextoTabla8">
            <div align="center"><%= sol.getCodSolicitud() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= sol.getCodCliente().getNombreCompleto() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= sol.getCodTipoTramite().getDescripcion() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= sol.getSfecha() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= sol.getDesc_estado() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= sol.getDesc_licencia() %></div></td></tr>
           <%
          }
        }
           if(hits==0){
            %>
          <tr class="even">
          <td>
            <div align="center">&nbsp; </div></td>
          <td class="TextoTabla8">
            <div align="center">&nbsp;</div></td>
          <td class="TextoTabla8">
            <div align="center">&nbsp;</div></td>
          <td class="TextoTabla8">
            <div align="center">&nbsp;</div></td>
          <td class="TextoTabla8">
            <div align="center">&nbsp;</div></td>
          <td class="TextoTabla8">
            <div align="center">&nbsp;</div></td>
          <td class="TextoTabla8">
            <div align="center">&nbsp;</div></td></tr>
             <%
           }
          %>      
            </tbody></table><br>
                
      <%if(hits!=0){%>
      <div >  
        <span class="pagebanner"><%=result.getTotalElements()%> líneas encontradas, mostrando <%= result.getFirstPageElement() %> a  <%=result.getLastPageElement()%>. </span>
        <span class="pagelinks">
          <% for(int i=1;i<=result.getNumberTotalPages();i++){
              if(i==result.getPage()){
              %>
             <strong><%=i%></strong>, 
             <%}else{%>
             <a href="javascript:Buscar(<%=i%>);" title="Go to page <%=i%>" onclick="Buscar(<%=i%>);"><%=i%></a>, 
          <% }
           }%>
         </span> 
      </div> 
      <br>
      <div class="exportlinks">Exportar: <a 
      href="javascript:ExportarXLS();"><span 
      class="export excel">Excel </span></a></div>
       <%}%>  
      <br><br></div></td></tr></tbody></table></div>
</form>
<script language="javascript">
highlightTableRows('row');
</script>
</body></html>
